package com.lzq.springblog.model;

import com.lzq.springblog.utils.DateUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.Date;

@Schema(name = "博客信息")
@Data
@Component
public class BlogInfo {
    @Schema(name = "博客id")
    private Integer id;
    @Schema(name = "博客标题")
    private String title;
    @Schema(name = "博客内容")
    private String content;
    @Schema(name = "写博客的用户id")
    private Integer userId;
    @Schema(name = "博客浏览数")
    private Integer viewCount;
    @Schema(name = "博客点赞数")
    private Integer likeCount;
    private Integer deleteFlag;
    @Schema(name = "博客创建时间")
    private Date createTime;
    private Date updateTime;
    private Boolean isLoginUser;
    public String getUpdateTime() {
        return DateUtils.format(updateTime);
    }
}
